/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background: rgb(68, 68, 68);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 52px; /* 32px窗口控制栏高度 + 20px原有padding */
}

/* 窗口控制按钮样式 */
.window-controls-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 32px;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10000;
    -webkit-app-region: drag;
}

.window-title {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
    margin-left: 16px;
    letter-spacing: 0.3px;
    -webkit-app-region: drag;
}

.window-controls {
    display: flex;
    align-items: center;
    gap: 1px;
    margin-right: 8px;
    -webkit-app-region: no-drag;
}

.control-btn {
    width: 32px;
    height: 24px;
    border: none;
    outline: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-app-region: no-drag;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 1);
    transform: translateY(-0.5px);
}

.control-btn:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.15);
}

.minimize-btn:hover {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.maximize-btn:hover {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.close-btn:hover {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.control-btn svg {
    display: block;
    width: 12px;
    height: 12px;
    color: inherit;
    fill: currentColor;
    stroke: currentColor;
    pointer-events: none;
    flex-shrink: 0;
}

/* Header */
.header {
    position: relative;
    text-align: center;
    padding: 40px 0 20px;
    z-index: 10;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Settings Button */
.settings-btn {
    position: absolute;
    right: 40px;
    top: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    outline: none;
}

.settings-btn svg {
    fill: #fff;
    transition: fill 0.3s;
}

.settings-btn:hover svg {
    fill: #000;
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 470px;
    transform: translate(-50%, -50%);
    background: rgba(24, 20, 20, 0.987);
    padding: 20px;
    border-radius: 10px;
    z-index: 1000;
    border: 1px solid #a970ff;
}

.settings-panel h2 {
    color: #fff;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.settings-panel button {
    background-color: #53535f;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 5px;
}

.settings-panel .add-sheet {
    background-color: #4285F4;
    color: #000;
    width: 100%;
    margin: 10px 0;
}

.settings-panel button:hover {
    background-color: #357ABD;
    color: #a8a8a8;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.sheet-item {
    margin: 10px 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.sheet-item input {
    flex: 1;
    outline: none;
    font-size: 14px;
    font-weight: 500;
    caret-color: #f7f7f8;
    color: #fff;
    padding: 7px 10px;
    background: #53535f;
    border: 2px solid transparent;
    border-radius: 7px;
    margin-right: 1px;
    transition: all .2s ease;
}

.sheet-item input:hover {
    border: 2px solid rgba(255, 255, 255, 0.16);
}

.sheet-item input:focus {
    border: 2px solid #a970ff;
    background-color: #0e0e10;
}

/* Main Form */
.entry-form {
    position: relative;
    margin-top: 20px;
    top: 50%;
    left: 50%;
    width: 750px;
    padding: 40px;
    transform: translate(-50%, 0%);
    background: rgba(0, 0, 0, .5);
    box-sizing: border-box;
    box-shadow: 0 15px 25px rgba(0, 0, 0, .6);
    border-radius: 10px;
}

.form-columns {
    display: flex;
    justify-content: space-between;
}

.column {
    flex: 1;
    margin-right: 40px;
}

.column:last-child {
    margin-right: 0;
}

/* Search Container */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 35px;
    flex-shrink: 0;
    margin-bottom: 30px;
    margin-right: 80px;
}

.input {
    max-width: 180px;
    height: 100%;
    outline: none;
    font-size: 14px;
    font-weight: 500;
    background-color: #53535f;
    caret-color: #f7f7f8;
    color: #fff;
    padding: 7px 10px;
    border: 2px solid transparent;
    border-top-left-radius: 7px;
    border-bottom-left-radius: 7px;
    margin-right: 1px;
    transition: all .2s ease;
}

.input:hover {
    border: 2px solid rgba(255, 255, 255, 0.16);
}

.input:focus {
    border: 2px solid #a970ff;
    background-color: #0e0e10;
}

.search__btn {
    border: none;
    cursor: pointer;
    background-color: rgba(42, 42, 45, 1);
    border-top-right-radius: 7px;
    border-bottom-right-radius: 7px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    height: 100%;
    width: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px;
    box-sizing: border-box;
}

.search__btn svg {
    width: 18px;
    height: 18px;
    fill: #efeff1;
}

.search__btn:hover {
    background-color: rgba(54, 54, 56, 1);
}

/* Form Fields */
.entry-form .user-box {
    position: relative;
    margin-bottom: 30px;
}

.entry-form .user-box input {
    width: 100%;
    padding: 10px 0;
    font-size: 16px;
    color: #fff;
    margin-bottom: 30px;
    border: none;
    border-bottom: 1px solid #fff;
    outline: none;
    background: transparent;
}

.entry-form .user-box label {
    position: absolute;
    top: 0;
    left: 0;
    padding: 10px 0;
    font-size: 14px;
    color: #fff;
    pointer-events: none;
    transition: .5s;
}

.entry-form .user-box input:focus ~ label,
.entry-form .user-box input:valid ~ label {
    top: -20px;
    left: 0;
    color: #bdb8b8;
    font-size: 12px;
}

.red-text {
    color: #ff0000 !important;
    caret-color: #ff0000;
}

.entry-form form a {
    position: relative;
    display: inline-block;
    padding: 10px 20px;
    color: #ffffff;
    font-size: 16px;
    text-decoration: none;
    text-transform: uppercase;
    overflow: hidden;
    transition: .5s;
    margin-top: 0px;
    letter-spacing: 4px;
    align-self: flex-end;
}

.entry-form a:hover {
    background: #03f40f;
    color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 5px #03f40f,
    0 0 25px #03f40f,
    0 0 50px #03f40f,
    0 0 100px #03f40f;
}

.entry-form a span {
    position: absolute;
    display: block;
}

@keyframes btn-anim1 {
    0% {
        left: -100%;
    }

    50%,100% {
        left: 100%;
    }
}

.entry-form a span:nth-child(1) {
    bottom: 2px;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #03f40f);
    animation: btn-anim1 2s linear infinite;
}

/* 移除按钮动画效果 */

/* Search Results */
#search-results {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #a970ff;
}

/* Batch Update Button */
.batch-update-btn {
    position: relative;
    display: inline-block;
    padding: 10px 20px;
    color: #ffffff;
    font-size: 16px;
    text-decoration: none;
    text-transform: uppercase;
    overflow: hidden;
    transition: .5s;
    margin-top: 10px;
    margin-left: 20px;
    letter-spacing: 4px;
    align-self: flex-end;
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid #ffa500;
    border-radius: 5px;
}

.batch-update-btn:hover {
    background: #ffa500;
    color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 5px #ffa500,
    0 0 25px #ffa500,
    0 0 50px #ffa500,
    0 0 100px #ffa500;
}

.batch-update-btn span {
    position: absolute;
    display: block;
}

.batch-update-btn span:nth-child(1) {
    bottom: 2px;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffa500);
    animation: btn-anim1 2s linear infinite;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #a970ff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Message Toast */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 15px 20px;
    border-radius: 5px;
    z-index: 10000;
    border: 1px solid #a970ff;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message-toast.success {
    background: rgba(72, 187, 120, 0.95);
    color: #fff;
}

.message-toast.error {
    background: rgba(229, 62, 62, 0.95);
    color: #fff;
}

.message-toast.warning {
    background: rgba(237, 137, 54, 0.95);
    color: #fff;
}

.message-toast.info {
    background: rgba(66, 153, 225, 0.95);
    color: #fff;
}

.message-toast button {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.message-toast button:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .entry-form {
        width: 90%;
        padding: 20px;
    }
    
    .form-columns {
        flex-direction: column;
    }
    
    .column {
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .settings-panel {
        width: 90%;
    }
    
    .header h1 {
        font-size: 2rem;
    }
}